<template>
<ion-page :className="{ 'view-container': true, 'default-mode-view': true, 'demobwfdynaeditview': true, 'shop-examine-mob-wfdyna-edit-view': true }">
    
    <app-mob-header>
        <ion-toolbar v-show="titleStatus" class="ionoc-view-header">
            <ion-buttons slot="start">
                <app-mob-button 
                    v-show="isShowBackButton" 
                    ref="backbtn"
                    iconName="chevron-back" 
                    :text="$t('app.button.back')" 
                    @click="closeView" />
            </ion-buttons>
            <app-mob-title class="view-title"><label class="title-label"><app-mob-icon v-if="model.icon" :name="model.icon"></app-mob-icon> <img v-else-if="model.iconcls" :src="model.iconcls" alt=""> {{$t(model.srfCaption)}}</label></app-mob-title>
        </ion-toolbar>
    </app-mob-header>
        <ion-content        >
                <component 
                    :is="activeForm.name"
                    :isautoload="true"
                    :viewState="viewState"  
                    :viewparams="viewparams" 
                    :context="context" 
                    :autosave="false" 
                    :viewtag="viewtag"
                    :showBusyIndicator="activeForm.showBusyIndicator"
                    :updateAction="activeForm.updateAction"
                    :removeAction="activeForm.removeAction"
                    :loaddraftAction="activeForm.loaddraftAction"
                    :loadAction="activeForm.loadAction"
                    :createAction="activeForm.createAction"
                    :WFSubmitAction="activeForm.WFSubmitAction"
                    :WFStartAction="activeForm.WFStartAction"
                    :srfwfmemo="srfwfmemo"
                    name="form"  
                    ref='form' 
                    @save="form_save($event)"  
                    @remove="form_remove($event)"  
                    @load="form_load($event)"  
                    @closeview="closeView($event)">
                </component>
    </ion-content>
    <ion-footer class="view-footer">
                <div class="wf-dy-button">
            <app-mob-button  
                v-for="(linkItem,index) in linkModel" :key="index"
                :text="linkItem.sequenceFlowName"
                @click="dynamic_toolbar_click(linkItem, $event)" />
        </div>

    </ion-footer>
</ion-page>
</template>

<script lang='ts'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import GlobalUiService from '@/global-ui-service/global-ui-service';
import Shop_examineService from '@/app-core/service/shop-examine/shop-examine-service';

import Shop_examineUIService from '@/ui-service/shop-examine/shop-examine-ui-action';
import { AnimationService } from '@ibiz-core/service/animation-service'
import { toastController, alertController } from '@ionic/core';
import AppCenterService from '@/ibiz-core/app-service/app/app-center-service';
import { Util } from '@/ibiz-core/utils';
import { ViewOpenService } from '@/utils/view-open-service/view-open-service';
//  临时引入
import WFDynaEditViewEngine from '@engine/view/mob-wfdyna-edit-view-engine';


@Component({
    components: {
    },
})
export default class Shop_examineMobWFDynaEditViewBase extends Vue {

    /**
     * 全局ui服务
     *
     * @type {GlobalUiService}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected globaluiservice: GlobalUiService = new GlobalUiService();

    /**
     * 实体服务对象
     *
     * @type {Shop_examineService}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected appEntityService: Shop_examineService = new Shop_examineService();

    /**
     * 实体UI服务对象
     *
     * @type Shop_examineUIService
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public appUIService: Shop_examineUIService = new Shop_examineUIService(this.$store);

    /**
     * 数据变化
     *
     * @param {*} val
     * @returns {*}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Emit() 
    protected viewDatasChange(val: any):any {
        return val;
    }

    /**
     * 视图上下文
     *
     * @type {string}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Prop() protected _context!: string;

    /**
     * 视图参数
     *
     * @type {string}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Prop() protected _viewparams!: string;

    /**
     * 视图默认使用
     *
     * @type {boolean}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Prop({ default: "routerView" }) protected viewDefaultUsage!: string;

	/**
	 * 视图标识
	 *
	 * @type {string}
	 * @memberof Shop_examineMobWFDynaEditViewBase
	 */
	protected viewtag: string = 'd04424c22eeb5f88e4fdaf6afe95451e';

    /**
     * 视图上下文
     *
     * @type {*}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected context: any = {};

    /**
     * 视图参数
     *
     * @type {*}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected viewparams: any = {};

    /**
     * 是否为子视图
     *
     * @type {boolean}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Prop({ default: false }) protected isChildView?: boolean;

    /**
     * 是否为门户嵌入视图
     *
     * @type {boolean}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Prop({ default: false }) protected isPortalView?: boolean;

    /**
     * 标题状态
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public titleStatus :boolean = true;

    /**
     * 视图导航上下文
     *
     * @protected
     * @type {*}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected navContext: any = {};

    /**
     * 视图导航参数
     *
     * @protected
     * @type {*}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected navParam: any = {};

    /**
     * 视图模型数据
     *
     * @type {*}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected model: any = {
        srfTitle: '入驻审核',
        srfCaption: 'shop_examine.views.mobwfdynaeditview.caption',
        srfSubCaption: '',
        dataInfo: '',
        viewname:'shop_examine.mobwfdynaeditview',
        iconcls: '',
        icon: ''
    }

    /**
     * 视图上下文变化
     *
     * @param {string} newVal
     * @param {string} oldVal
     * @memberof  Shop_examineMobWFDynaEditViewBase
     */
    @Watch('_context')
    on_context(newVal: string, oldVal: string) {
        const _this: any = this;
        this.parseViewParam();
        if (!Object.is(newVal, oldVal) && _this.engine) {
            this.$nextTick(()=>{_this.engine.load();})
        }
        
    }

    /**
     * 视图参数变化
     *
     * @param {string} newVal
     * @param {string} oldVal
     * @returns
     * @memberof IBizChart
     */
    @Watch('_viewparams',{immediate: true, deep: true})
    on_viewparams(newVal: string, oldVal: string) {
        this.parseViewParam();
        
    }

    /**
     * 设置工具栏状态
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public setViewTitleStatus(){
        const thirdPartyName = this.$store.getters.getThirdPartyName();
        if(thirdPartyName){
            this.titleStatus = false;
        }
    }

    /**
     * 容器模型
     *
     * @type {*}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected containerModel: any = {
        view_quicktoolbar: { name: 'quicktoolbar', type: 'TOOLBAR' },
        view_form: { name: 'form', type: 'FORM' },
        view_righttoolbar: { name: 'righttoolbar', type: 'TOOLBAR' },
        wflinks: [],
    };

    /**
     * 视图状态订阅对象
     *
     * @type {Subject<{action: string, data: any}>}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected viewState: Subject<ViewState> = new Subject();


    /**
     * 是否显示标题
     *
     * @type {string}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Prop({default:true}) protected showTitle?: boolean;


   /**
    * 工具栏 Shop_examineMobWFDynaEditView 模型
    *
    * @type {*}
    * @memberof Shop_examineMobWFDynaEditView
    */
    public quicktoolbarModels: any = {
    };

    




   /**
    * 工具栏 Shop_examineMobWFDynaEditView 模型
    *
    * @type {*}
    * @memberof Shop_examineMobWFDynaEditView
    */
    public righttoolbarModels: any = {
    };

    


    /**
     * 工具栏模型集合名
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public toolbarModelList:any = ['quicktoolbarModels','righttoolbarModels',]

    /**
     * 解析视图参数
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected parseViewParam(): void {
        const { context, param } = this.$viewTool.formatNavigateViewParam(this, true);
        this.context = { ...context };
        this.viewparams = { ...param }
    }

    /**
     * 是否显示返回按钮
     *
     * @readonly
     * @type {boolean}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    get isShowBackButton(): boolean {
        // 存在路由，非路由使用，嵌入
        if (this.viewDefaultUsage === "indexView") {
            return false;
        }
        return true;
    }


    /**
     * 引擎初始化
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected engineInit(): void {
        //  动态工作流编辑视图 临时
        this.engine.init({
            form: this.$refs.form,
            view: this,
            keyPSDEField: 'shop_examine',
            majorPSDEField: 'examine_shop_name',
            isLoadDefault: true
        })
    }

    /**
     * Vue声明周期
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected created() {
        this.afterCreated();
    }

    /**
     * 执行created后的逻辑
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */    
    protected afterCreated(){
        const secondtag = this.$util.createUUID();
        this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
        this.viewtag = secondtag;
        this.parseViewParam();
        this.setViewTitleStatus();


    }


    /**
     * 销毁之前
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected beforeDestroy() {
        this.$store.commit('viewaction/removeView', this.viewtag);
    }

    /**
     * Vue声明周期
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public activated() {
        this.thirdPartyInit();
    }



    /**
     * Vue声明周期(组件初始化完毕)
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected mounted() {
        this.afterMounted();
    }


    /**
     * 执行mounted后的逻辑
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected afterMounted(){
        const _this: any = this;
        _this.engineInit();
        if (_this.loadModel && _this.loadModel instanceof Function) {
            _this.loadModel();
        }
        this.thirdPartyInit();

    }

    /**
     * 第三方容器初始化
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected  thirdPartyInit(){
        const _this:any = this;  
        if(!this.isChildView){
            this.$viewTool.setViewTitleOfThirdParty(this.$t(this.model.srfCaption) as string);
            this.$viewTool.setThirdPartyEvent(this.closeView);
            this.$viewTool.initRightBtn(_this.righttoolbarModels,_this.righttoolbar_click);
        }
    }

    /**
     * 销毁视图回调
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected destroyed(){
        this.afterDestroyed();
    }

    /**
     * 执行destroyed后的逻辑
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected afterDestroyed(){
        if (this.viewDefaultUsage !== "indexView" && Object.keys(localStorage).length > 0) {
            Object.keys(localStorage).forEach((item: string) => {
                if (item.startsWith(this.context.srfsessionid)) {
                    localStorage.removeItem(item);
                }
            });
        }

    }


    /**
     * 第三方关闭视图
     *
     * @param {any[]} args
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public quitFun() {
        if (!sessionStorage.getItem("firstQuit")) {  // 首次返回时
            // 缓存首次返回的时间
            window.sessionStorage.setItem("firstQuit", new Date().getTime().toString());
            // 提示再按一次退出
            this.$toast("再按一次退出");
            // 两秒后清除缓存（与提示的持续时间一致）
            setTimeout(() => {window.sessionStorage.removeItem("firstQuit")}, 2000);
        } else {
            // 获取首次返回时间
            let firstQuitTime: any = sessionStorage.getItem("firstQuit");
            // 如果时间差小于两秒 直接关闭
            if (new Date().getTime() - firstQuitTime < 2000) {
                this.$viewTool.ThirdPartyClose();
            }
        }
    }
    
    /**
     * 关闭视图
     *
     * @param {any[]} args
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    protected async closeView(args: any[]): Promise<any> {
        if(this.$store.state.searchformStatus){
             this.$store.commit('setSearchformStatus',false);
             return
        }
        if(this.viewDefaultUsage==="indexView" && this.$route.path === '/appindexview'){
            this.quitFun();
            return;
        }
        if (this.viewDefaultUsage === "routerView" ) {
           if(window.history.length == 1 && this.$viewTool.getThirdPartyName()){
                this.quitFun();
            }else{
                this.$store.commit("deletePage", this.$route.fullPath);
                this.$router.go(-1);
           }
        }
        if (this.viewDefaultUsage === "actionView") {
            this.$emit("close", { status: "success", action: "close", data: args instanceof MouseEvent ? null : args });
        }
        
    }

    /**
     * 刷新数据
     *
     * @readonly
     * @type {(number | null)}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    get refreshdata(): number | null {
        return this.$store.getters['viewaction/getRefreshData'](this.viewtag);
    }

    /**
     * 监控数据变化
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @returns
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    @Watch('refreshdata')
    onRefreshData(newVal: any, oldVal: any) {
        if (newVal === null || newVal === undefined) {
            return;
        }
        if (newVal === 0) {
            return;
        }
        const _this: any = this;
        if (_this.onRefreshView && _this.onRefreshView instanceof Function) {
            _this.onRefreshView();
        }
    }

    /**
     * 初始化导航栏标题
     *
     * @param {*} val
     * @param {boolean} isCreate
     * @returns
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public initNavCaption(val:any,isCreate:boolean){
        this.$viewTool.setViewTitleOfThirdParty(this.$t(this.model.srfCaption) as string);        
    }


    /**
     * 工作流审批意见控件绑定值
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public srfwfmemo: string = "";

    /**
     * 工具栏模型数据
     *
     * @type {Array<any>}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public linkModel: Array<any> = [];

    /**
     * 激活表单
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public activeForm:any = {};

    /**
     * 所有表单数据
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public allForm: any = {
        "form":{name:"view_form",autosave:"false",showBusyIndicator:"true",updateAction:"Update",removeAction:"Remove",loaddraftAction:"GetDraft",loadAction:"Get",createAction:"Create",WFSubmitAction:"",WFStartAction:""},
    };

    /**
     * 工作流附加功能类型映射关系对象
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase                
     */
    public wfAddiFeatureRef: any = {
        "reassign": { featureTag: "REASSIGN", action: "TransFerTask" },
        "addstepbefore": { featureTag: "ADDSTEPBEFORE", action: "BeforeSign" },
        "sendback": { featureTag: "SENDBACK", action: "SendBack" },
        "sendcopy": { featureTag: "SENDCOPY", action: "sendCopy" }
    };

    //  临时提交部分 --- start

    /**
     * 初始化引擎（临时）
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public engine: WFDynaEditViewEngine = new WFDynaEditViewEngine();

    /**
     * 表单加载
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public form_load(event: any) {
        this.engine.onCtrlEvent('form', 'load', event);
    }

    /**
     * 表单保存
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public form_save(event: any) {
        this.engine.onCtrlEvent('form', 'save', event);
    }

    /**
     * 表单删除
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public form_remove(event: any) {
        this.engine.onCtrlEvent('form', 'remove', event);
    }

    //  临时提交部分 --- end
    
    /**
     * 获取工具栏按钮
     *
     * @returns {Promise<any>}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public async getWFLinkModel(): Promise<any> {
        let datas: any = {};
        if (Object.keys(this.viewparams).length > 0) {
            Object.assign(datas, { 'processDefinitionKey': this.viewparams.processDefinitionKey });
            Object.assign(datas, { 'taskDefinitionKey': this.viewparams.taskDefinitionKey });
        }
        const response: any = await this.appEntityService.GetWFLink({ ...this.context }, datas);
        if (response && response.status === 200) {
            this.linkModel = response.data;
            if(response.headers && response.headers['process-mobform']){
                this.computeActivedForm(response.headers['process-mobform']);
            }else{
                this.computeActivedForm(null);
            }
        } else {
            const { data: _data } = response;
            this.$notice.error(_data.message);
        }
        return response;
    }

    /**
     * 动态工具栏点击
     *
     * @param {*} linkItem
     * @param {*} $event
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public async dynamic_toolbar_click(linkItem: any, $event: any) {
        const _this: any = this
        let datas: any[] = [];
        let xData: any = this.$refs.form;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
        const submit: Function = (submitData: any, linkItem: any) => {
            xData.wfsubmit(submitData, linkItem).then((response: any) => {
                if (!response || response.status !== 200) {
                    return;
                }
                const { data: _data } = response;
                this.closeView([{ ..._data }]);
            });
        }
         const submitAction: Function = () => {
            if (linkItem && linkItem.sequenceflowmobview) {
                const targetView = this.viewRefData[`WFACTION@${linkItem.sequenceflowmobview}`];
                if (targetView) {
                    let tempContext: any = Util.deepCopy(_this.context);
                    Object.assign(tempContext, { 'id': datas && datas[0].srfkey });
                    let tempViewParam: any = { actionView: linkItem.sequenceflowmobview, actionForm: linkItem.sequenceflowmobform };
                    ViewOpenService.getInstance().openModal(targetView, tempContext, tempViewParam).then((result: any) => {
                        if (!result || !Object.is(result.ret, 'OK')) {
                            return;
                        }
                        let tempSubmitData: any = Util.deepCopy(datas[0]);
                        if (result.datas && result.datas[0]) {
                            const resultData: any = result.datas[0];
                            if (Object.keys(resultData).length > 0) {
                                let tempData: any = {};
                                Object.keys(resultData).forEach((key: any) => {
                                    if (resultData[key] && (key !== "srfuf")) tempData[key] = resultData[key];
                                })
                                Object.assign(tempSubmitData, tempData);
                            }
                        }
                        submit([tempSubmitData], linkItem);
                    })
                }
            } else {
                submit(datas, linkItem);
            }
        }
        if (linkItem && linkItem.type) {
            if (Object.is(linkItem.type, "finish")) {
                submitAction();
            } else {
                this.handleWFAddiFeature(linkItem);
            }
        } else {
            submitAction();
        }
    }

    /**
     * 处理工作流辅助功能
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase      
     */
    public handleWFAddiFeature(linkItem: any) {
        let featureTag: string = this.wfAddiFeatureRef[linkItem?.type]?.featureTag;
        if (!featureTag) return;
        let targetView: any = this.viewRefData[`WFUTILACTION@${featureTag}`];
        if (!targetView) {
            console.warn(this.$t('app.wizardpanel.nofind'))
            return;
        }
        // 准备参数
        let datas: any[] = [];
        let xData: any = this.$refs.form;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
        let tempContext: any = Util.deepCopy(this.context);
        Object.assign(tempContext, { 'id': datas && datas[0].srfkey });
        let tempViewParam: any = { actionView: linkItem.sequenceflowmobview, actionForm: linkItem.sequenceflowmobform };
        ViewOpenService.getInstance().openModal(targetView, tempContext, tempViewParam).then((result: any) => {
            if (!result || !Object.is(result.ret, 'OK')) {
                return;
            }
            let tempSubmitData: any = Util.deepCopy(datas[0]);
            if (result.datas && result.datas[0]) {
                const resultData: any = result.datas[0];
                if (Object.keys(resultData).length > 0) {
                    let tempData: any = {};
                    Object.keys(resultData).forEach((key: any) => {
                        if (resultData[key] && (key !== "srfuf")) tempData[key] = resultData[key];
                    })
                    Object.assign(tempSubmitData, tempData);
                }
                this.submitWFAddiFeature(linkItem, tempSubmitData);
            }
        });
    }

    
    /**
     * 提交工作流辅助功能
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public submitWFAddiFeature(linkItem: any, submitData: any) {
        let tempSubmitData: any = Object.assign(linkItem, { "activedata": submitData });
        let action: string = this.wfAddiFeatureRef[linkItem?.type]?.action;
        if (!action) return;
        (this.appEntityService as any)[action](Util.deepCopy(this.context), tempSubmitData).then((response: any) => {
            const { data: data } = response;
            if (!response || response.status !== 200) {
                this.$notice.error(response);
                return;
            }
            let _this: any = this;
            this.closeView([{ ...data }]);
            AppCenterService.notifyMessage({ name: 'Shop_examine', action: 'appRefresh', data: data });
            this.$notice.success(data?.message ? data.message : this.$t('app.wizardpanel.success'))
        }).catch((error: any) => {
            this.$notice.error(error);
        })
    }

    /**
     * 工作流审批意见
     *
     * @protected
     * @param {*} linkItem
     * @returns {Promise<any>}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public async openSrfwfmemo(linkItem:any,data:any) :Promise<any>{
        if(linkItem && linkItem.sequenceflowmobview && this.viewRefData[`WFACTION@${linkItem.sequenceflowmobview}`]){
            let tempContext:any = this.$util.deepCopy(this.context);
            let tempViewParam:any = {actionView:linkItem.sequenceflowmobview,actionForm:linkItem.sequenceflowmobform};
            let targetView:any = this.viewRefData[`WFACTION@${linkItem.sequenceflowmobview}`];
            const result: any = await this.$appmodal.openModal(targetView,tempContext,tempViewParam);
            if (result || Object.is(result.ret, 'OK')) {
                const { datas } = result;
                if(datas[0].srfwfmemo){
                    this.srfwfmemo = datas[0].srfwfmemo;
                }
            }
        }
        return true;
    }

    /**
     * 视图引用数据
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public viewRefData:any = {
        "WFACTION@TAMobWFDynaActionView":{viewname:"shop-examine-tamob-wfdyna-action-view",title:"entities.shop_examine.views.tamobwfdynaactionview.caption", width: 800, height: 500},
        "WFACTION@TJMobWFDynaActionView":{viewname:"shop-examine-tjmob-wfdyna-action-view",title:"entities.shop_examine.views.tjmobwfdynaactionview.caption", width: 800, height: 500},
        "WFACTION@CJMobWFDynaActionView":{viewname:"shop-examine-cjmob-wfdyna-action-view",title:"entities.shop_examine.views.cjmobwfdynaactionview.caption", width: 800, height: 500},
        "WFACTION@MobWFDynaActionView":{viewname:"shop-examine-mob-wfdyna-action-view",title:"entities.shop_examine.views.mobwfdynaactionview.caption", width: 800, height: 500}
    };


    /**
     * 计算激活表单
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public computeActivedForm(inputForm:any){
        if(!inputForm){
            this.activeForm = this.allForm && Object.values(this.allForm)[0];
            return;
        }
        if(this.allForm && Object.keys(this.allForm).length >0){
            Object.keys(this.allForm).forEach((name:string) =>{
                if(Object.is(name,`wfform_${inputForm.toLowerCase()}`)){
                    this.activeForm = this.allForm[name];
                }
            })
        }
    }

    /**
     * 工具栏分组是否显示的条件
     *
     * @type {boolean}
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public showGrop = false;

    /**
     * 工具栏分组是否显示的方法
     *
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public popUpGroup (falg:boolean = false) {
        this.showGrop = falg;
    }

    /**
     * 底部按钮样式
     * 
     * @memberof Shop_examineMobWFDynaEditViewBase
     */
    public button_style = "";



}
</script>

<style lang='less'>
@import './shop-examine-mob-wfdyna-edit-view.less';
</style>
